package com.demo.controller;

import com.demo.po.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * @author 姚贺鹏
 * @company 广州市初放网络科技有限公司
 * @ClassName UserController
 * @Description
 * @date 2017/5/22 0022下午 4:52
 * @Copyright (c) 2017, yaohepeng@chufanginc.com All Rights Reserved.
 */
@Controller
public class UserController {
    //    localhost:8888/ssm/user/showUser?id=1   &name=张三  get请求

    @RequestMapping("/user")
    @ResponseBody
    public User toIndex(HttpServletRequest request, Model model) {
        User user = new User();
        user.setUsername("wo");
        return user;
    }

}
